create database QuanLyTuyenDung;
go
use QuanLyTuyenDung;
go
create table Nhanvien(
	mannv int identity primary key,
	tennv nvarchar(30),
	tendn nvarchar(30),
	matkhau nvarchar(10),
	ngaysinh datetime,
	phongban nvarchar(30),
	role nvarchar(20)
);
go
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Thieu Quoc Nghi','nghitq','123456','09/08/1990','Tuyen dung','admin')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Nguyen Son Tung','tungns','123456','11/12/1990','Tuyen dung','admin')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Bui Thanh Tung','tungbt','123456','02/03/1990','Tuyen dung','admin')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Vu Chi Cong','congvc','123456','04/08/1990','Tuyen dung','admin')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Thieu Quoc Nghi','nghi','123456','04/07/1990','Kinh doanh','interviewer')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Nguyen Son Tung','sontung','123456','04/02/1990','Kinh doanh','interviewer')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Nguyen Tien Manh','manh','123456','04/07/1990','IT','interviewer')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Bui Thanh Tung','tung','123456','04/07/1990','IT','interviewer')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Le Hoang','hoang','123456','04/07/1990','Kinh doanh','interviewer')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Vu Chi Cong','cong','123456','04/07/1990','Cong Nghe','interviewer')
insert into Nhanvien(tennv,tendn,matkhau,ngaysinh,phongban,role) values('Nguyen Hoang Hiep','hiep','123456','04/07/1990','Kinh doanh','interviewer')
go
create table Applicant(
	appid int identity primary key,
	aname nvarchar(30),
	aprofile text,
	vname nvarchar(30),
	astatus nvarchar(20)
);
go
insert into Applicant(aname,aprofile,vname,astatus) values('Le Thanh Hoang','Tot nghiep dai hoc chinh quy bang Kha,Chung chi tieng Anh A,B,C','Kinh doanh','')
insert into Applicant(aname,aprofile,vname,astatus) values('Nguyen Minh Tien','Tot nghiep bang Kha - CNTT,Chung chi tieng Anh A,B,C','IT','')
insert into Applicant(aname,aprofile,vname,astatus) values('Hoang Xuan Vinh','Tot nghiep dai hoc bang Kha,Chung chi tin hoc','Ke Toan','')
insert into Applicant(aname,aprofile,vname,astatus) values('Bui Hoang Thao','Aptech Bach Khoa,Chung chi tieng Anh A,B,C','IT','')
insert into Applicant(aname,aprofile,vname,astatus) values('Nguyen Tra My','Aptech Bach Khoa','IT','')
insert into Applicant(aname,aprofile,vname,astatus) values('Bui Hoang Hiep','Cu nhan DHKTQD','Kinh doanh','')
insert into Applicant(aname,aprofile,vname,astatus) values('Nguyen Minh Hoang','Dai hoc Bach Khoa,Tieng Nhat','IT','')
insert into Applicant(aname,aprofile,vname,astatus) values('Vu Thao Phuog','Dai hoc Ngoai Thuong','Kinh doanh','')
insert into Applicant(aname,aprofile,vname,astatus) values('Tran Duc Cuong','Tot nghiep dai hoc Cong nghe','IT','')
insert into Applicant(aname,aprofile,vname,astatus) values('Pham Van Dung','Dai hoc Ngoai Thuong','Kinh doanh','')
go
create table Vacancy(
	vid int identity primary key,
	vname nvarchar(30),
	vdepartment nvarchar(30),
	vnumber int,
	vstatus nvarchar(20)
);
go 
insert into Vacancy(vname,vdepartment,vnumber,vstatus) values ('Kinh doanh','Kinh doanh',3,'chua du')
insert into Vacancy(vname,vdepartment,vnumber,vstatus) values ('IT','Cong nghe',3,'chua du')
insert into Vacancy(vname,vdepartment,vnumber,vstatus) values ('Ke toan','Cong nghe',1,'chua du')
insert into Vacancy(vname,vdepartment,vnumber,vstatus) values ('Ke toan','Kinh doanh',2,'chua du')
go
drop table Interview
create table Interview(
	iid int identity primary key,
	idate datetime,
	interviewer nvarchar(30),
	aname nvarchar(30),
	vname nvarchar(30),
	istatus nvarchar(20)
);
go
insert into Interview(idate,interviewer,aname,vname,istatus) values ('12/06/2012 09:00','Thieu Quoc Nghi','Le Thanh Hoang','Kinh doanh','chua bat dau')
insert into Interview(idate,interviewer,aname,vname,istatus) values ('03/06/2012 09:00','Nguyen Son Tung','Pham Van Dung','Kinh doanh','')
insert into Interview(idate,interviewer,aname,vname,istatus) values ('07/06/2012 08:30','Bui Thanh Tung','Vu Thao Phuong','Kinh doanh','')
insert into Interview(idate,interviewer,aname,vname,istatus) values ('12/06/2012 09:30','Thieu Quoc Nghi','Tran Duc Cuong','Kinh doanh','')
go